package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.FertilizerConsumeTemporaryMapper;
import com.ruoyi.consume.domain.FertilizerConsumeTemporary;
import com.ruoyi.consume.service.IFertilizerConsumeTemporaryService;

/**
 * 查看临时领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class FertilizerConsumeTemporaryServiceImpl implements IFertilizerConsumeTemporaryService
{
    @Autowired
    private FertilizerConsumeTemporaryMapper fertilizerConsumeTemporaryMapper;

    /**
     * 查询查看临时领用信息
     *
     * @param fertilizerConsumeTemporaryId 查看临时领用信息ID
     * @return 查看临时领用信息
     */
    @Override
    public FertilizerConsumeTemporary selectFertilizerConsumeTemporaryById(Long fertilizerConsumeTemporaryId)
    {
        return fertilizerConsumeTemporaryMapper.selectFertilizerConsumeTemporaryById(fertilizerConsumeTemporaryId);
    }

    /**
     * 查询查看临时领用信息列表
     *
     * @param fertilizerConsumeTemporary 查看临时领用信息
     * @return 查看临时领用信息
     */
    @Override
    public List<FertilizerConsumeTemporary> selectFertilizerConsumeTemporaryList(FertilizerConsumeTemporary fertilizerConsumeTemporary)
    {
        return fertilizerConsumeTemporaryMapper.selectFertilizerConsumeTemporaryList(fertilizerConsumeTemporary);
    }

    /**
     * 新增查看临时领用信息
     *
     * @param fertilizerConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int insertFertilizerConsumeTemporary(FertilizerConsumeTemporary fertilizerConsumeTemporary)
    {
        fertilizerConsumeTemporary.setCreateTime(DateUtils.getNowDate());
        return fertilizerConsumeTemporaryMapper.insertFertilizerConsumeTemporary(fertilizerConsumeTemporary);
    }

    /**
     * 修改查看临时领用信息
     *
     * @param fertilizerConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int updateFertilizerConsumeTemporary(FertilizerConsumeTemporary fertilizerConsumeTemporary)
    {
        fertilizerConsumeTemporary.setUpdateTime(DateUtils.getNowDate());
        return fertilizerConsumeTemporaryMapper.updateFertilizerConsumeTemporary(fertilizerConsumeTemporary);
    }

    /**
     * 批量删除查看临时领用信息
     *
     * @param fertilizerConsumeTemporaryIds 需要删除的查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerConsumeTemporaryByIds(Long[] fertilizerConsumeTemporaryIds)
    {
        return fertilizerConsumeTemporaryMapper.deleteFertilizerConsumeTemporaryByIds(fertilizerConsumeTemporaryIds);
    }

    /**
     * 删除查看临时领用信息信息
     *
     * @param fertilizerConsumeTemporaryId 查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerConsumeTemporaryById(Long fertilizerConsumeTemporaryId)
    {
        return fertilizerConsumeTemporaryMapper.deleteFertilizerConsumeTemporaryById(fertilizerConsumeTemporaryId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<FertilizerConsumeTemporary> getUserName(){
        return fertilizerConsumeTemporaryMapper.getUserName();
    }
}
